package com.binance.mbxgateway.api;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import com.binance.master.configs.FeignConfig;
import com.binance.master.constant.Constant;
import com.binance.master.models.APIRequest;
import com.binance.master.models.APIResponse;
import com.binance.mbxgateway.vo.request.order.DeleteAllOrderRequest;
import com.binance.mbxgateway.vo.request.order.DeleteOrderRequest;
import com.binance.mbxgateway.vo.request.order.DeleteOrderResponse;
import com.binance.mbxgateway.vo.request.order.PlaceOrderRequest;
import com.binance.mbxgateway.vo.response.order.PlaceOrderResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api
@FeignClient(name = Constant.MBX_GATEWAY_SERVICE, configuration = FeignConfig.class)
public interface IOrderApi {

    @ApiOperation("下单")
    @PostMapping(value = "/private/order", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<PlaceOrderResponse> placeOrder(@RequestBody APIRequest<PlaceOrderRequest> request)
            throws Exception;

    @ApiOperation("撤单")
    @PostMapping(value = "/private/deleteOrder", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<DeleteOrderResponse> deleteOrder(@RequestBody APIRequest<DeleteOrderRequest> request) throws Exception;

    @ApiOperation("撤单")
    @PostMapping(value = "/private/deleteAll", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public APIResponse<DeleteOrderResponse> deleteAllOrder(@RequestBody APIRequest<DeleteAllOrderRequest> request) throws Exception;

}
